<?php

namespace App\Http\Controllers\Stats\Game;

use Helper\Timed;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Resources\Common\DataResource;
use App\Services\Stats\Game\Best\Elasticsearch\PlayerBetService;
use App\Services\Stats\Game\Best\Elasticsearch\PlayerGainService;
use App\Services\Stats\Game\Best\Elasticsearch\PlayerCountService;
use App\Services\Stats\Game\Best\Elasticsearch\DocCountService;
use Ramsey\Uuid\Type\Time;

class BestController extends Controller
{

	public function __construct()
	{
		Timed::setForceAbs();
	}

    /**
     * 获取最佳游戏【PlayerBet】
     */
    public function topPlayerBet(Request $request)
    {
        $data = PlayerBetService::create()->getTopList($request);

        return DataResource::make($data);
    }

    /**
     * 获取最佳游戏【PlayerGain】
     */
    public function topPlayerGain(Request $request)
    {
        $data = PlayerGainService::create()->getTopList($request);

        return DataResource::make($data);
    }

    /**
     * 获取最佳游戏【PlayerCount】
     */
    public function topPlayerCount(Request $request)
    {
        $data = PlayerCountService::create()->getTopList($request);

        return DataResource::make($data);
    }

    /**
     * 获取最佳游戏【DocCount】
     */
    public function topDocCount(Request $request)
    {
        $data = DocCountService::create()->getTopList($request);

        return DataResource::make($data);
    }
}
